using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for Item
/// </summary>
public class Item
{
    int id;
    int orderId;
    string name;
    decimal price;   
    string imageURL;
    int quantity;
    float saleOff;
    string info;
    int typeID;
    DateTime modifiedDate;
	public Item()
	{
        id = -1;
        orderId = -1;
        name = "";
        price = 0;    
        quantity = 0;
        imageURL = "";
        saleOff = 0;
        info = "";
        typeID = -1;
        modifiedDate = new DateTime();
	}
    public int ID
    {
        get { return this.id; }
        set { id = value; }
    }
    public int OrderID
    {
        get { return orderId; }
        set { orderId = value; }
    }
    public string Name
    {
        get { return name; }
        set { name = value; }
    }
    public decimal Price
    {
        get { return price; }
        set { price = value; }
    }
    public decimal NewPrice
    {
        get
        {
            return price - (decimal)saleOff;            
        }
    }
    public int Quantity
    {
        get { return quantity; }
        set { quantity = value; }
    }
    public decimal Amount
    {
        get { return price * quantity; }
    }
    public string ImageURL
    {
        get { return imageURL; }
        set { imageURL = value; }
    }
    public float SaleOff
    {
        get { return saleOff; }
        set { saleOff = value; }
    }
   
    public string Information
    {
        get { return info; }
        set { info = value; }
    }
    public int TypeID
    {
        get { return typeID; }
        set { typeID = value; }
    }
    public DateTime ModifiedDate
    {
        get { return modifiedDate; }
        set { modifiedDate = value; }
    }
    #region methods
    public override bool Equals(object obj)
    {
        Item item = obj as Item;
        if (item == null) return false;
        return item.ID == this.id;
    }
    #endregion
}
